
package com.xnyzc.lhy.nio.feign.netty;

import com.xnyzc.lhy.common.entity.Qd;
import com.xnyzc.lhy.nio.entity.netty.DriverVehInfo;
import com.xnyzc.lhy.nio.entity.netty.MileageParam;
import com.xnyzc.lhy.nio.entity.netty.TimeParam;
import com.xnyzc.lhy.nio.feign.fallback.netty.FeignNettyServiceFallback;
import com.xnyzc.lhy.order.entity.order.OaCOrder;
import com.xnyzc.lhy.order.entity.system.OaSysBillRules;
import com.xnyzc.lhy.order.entity.user.OaCUser;
import com.xnyzc.lhy.order.entity.user.OaDUser;
import com.xnyzc.lhy.order.entity.user.OaDUserInfo;
import com.xnyzc.lhy.order.entity.vehicle.OaDDriverVehicle;
import com.xnyzc.lhy.order.entity.vehicle.OaSysVehicle;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.math.BigDecimal;
import java.util.List;

/**
 * <p>
 * netty服务间调用
 * </p>
 *
 * @author liuju
 * @since 2019-09-20
 */

@FeignClient(name = "${feign.applicationName.order}", fallback = FeignNettyServiceFallback.class)
public interface FeignNettyService {


    /**
     * netty 获取司机车辆信息
     *
     * @param vehicleId
     * @return
     */
    @GetMapping("/dapi/vehicleIntegration/getDDriverVehicleInfo")
    DriverVehInfo getDDriverVehicleInfo(@RequestParam("vehicleId") String vehicleId);

    /**
     * netty 获取车辆信息
     *
     * @param vehicleId
     * @return
     */
    @GetMapping("/dapi/vehicleIntegration/getSysVehicleInfo")
    OaSysVehicle getSysVehicleInfo(@RequestParam("vehicleId") Long vehicleId);

    /**
     * netty 获取里程费
     *
     * @return
     */
    @PostMapping("/dapi/vehicleIntegration/getMileageFee")
    BigDecimal getMileageFee(@RequestBody MileageParam param);

    /**
     * netty 获取里程费
     *
     * @return
     */
    @PostMapping("/dapi/vehicleIntegration/getMileageFeeByOrder")
    OaCOrder getMileageFeeByOrder(@RequestBody OaCOrder oaCOrder);

    /**
     * netty 获取远途费
     *
     * @return
     */
    @PostMapping("/dapi/vehicleIntegration/getDistanceFeeByOrder")
    OaCOrder getDistanceFeeByOrder(@RequestBody OaCOrder oaCOrder);

    /**
     * netty 获取时长费
     *
     * @return
     */
    @PostMapping("/dapi/vehicleIntegration/getTimeFee")
    BigDecimal getTimeFee(@RequestBody TimeParam param);

    /**
     * netty 获取时长费
     *
     * @return
     */
    @PostMapping("/dapi/vehicleIntegration/getTimeFeeByIdOrder")
    OaCOrder getTimeFeeByIdOrder(@RequestBody OaCOrder oaCOrder);

    /**
     * netty 获取总费用
     *
     * @param totalFee
     * @param baseFee
     * @param userType
     * @param drawRatio
     * @return
     */
    @GetMapping("/orderCommon/getTotalFee")
    BigDecimal getTotalFee(@RequestParam("totalFee") BigDecimal totalFee, @RequestParam("baseFee") BigDecimal baseFee,
                           @RequestParam("userType") Integer userType, @RequestParam("drawRatio") BigDecimal drawRatio);

    /**
     * netty 获取计费规则费用
     *
     * @param rulesId
     * @param tag
     * @return
     */
    @GetMapping("/orderCommon/getBillRulesStartFee")
    OaSysBillRules getBillRulesStartFee(@RequestParam("rulesId") String rulesId, @RequestParam("tag") String tag);

    /**
     * 判断是否评价过
     *
     * @param userId
     * @param type
     * @param orderNo
     * @return
     */
    @GetMapping("/orderCommon/isEvaluation")
    Integer isEvaluation(@RequestParam("userId") Long userId, @RequestParam("type") Integer type, @RequestParam("orderNo") String orderNo);

    /**
     * 获取历史轨迹
     *
     * @param orderNo
     * @return
     */
    @GetMapping("/orderCommon/getHistroyGpsList")
    List<Qd> getHistroyGpsList(@RequestParam("orderNo") String orderNo);

    /**
     * 获取订单信息
     *
     * @param orderNo
     * @return
     */
    @GetMapping("/orderCommon/getOrderInfo")
    OaCOrder getOrderInfo(@RequestParam("orderNo") String orderNo);

    /**
     * 获取用户信息
     *
     * @param userId
     * @return
     */
    @GetMapping("/orderCommon/getUserInfo")
    OaCUser getUserInfo(@RequestParam("userId") Long userId);

    /**
     * 乘客端获取当前等待人数等信息
     *
     * @param lng
     * @param lat
     * @return
     */
    @GetMapping("/orderCommon/getNearbyVehicles")
    Integer getNearbyVehicles(@RequestParam("lng") String lng, @RequestParam("lat") String lat);


    /**
     * 获取司机用户信息
     *
     * @param driverId
     * @return
     */
    @GetMapping("/orderCommon/getOaDUser")
    OaDUser getOaDUser(@RequestParam("driverId") Long driverId);

    /**
     * 获取司机用户信息详情
     *
     * @param driverId
     * @return
     */
    @GetMapping("/orderCommon/getOaDUserInfo")
    OaDUserInfo getOaDUserInfo(@RequestParam("driverId") Long driverId);

    /**
     * 获取司机车辆信息
     *
     * @param driverId
     * @param isUse
     * @return
     */
    @GetMapping("/orderCommon/getOaDDriverVehicleInfo")
    OaDDriverVehicle getOaDDriverVehicleInfo(@RequestParam("driverId") Long driverId, @RequestParam("isUse") Integer isUse);

    /**
     * netty 获取远途费
     *
     * @return
     */
    @PostMapping("/dapi/vehicleIntegration/getDistanceFee")
    BigDecimal getDistanceFee(MileageParam param);

    /**
     * netty 获取抽佣后的金额
     *
     * @return
     */
    @PostMapping("/dapi/vehicleIntegration/getDrawFee")
    BigDecimal getDrawFee(@RequestParam("totalBillFee") BigDecimal totalBillFee, @RequestParam("rulesId") String rulesId);
}
